<%@page import="com.lzl.dao.Goodsdaoimpl"%>
<%@page import="com.lzl.entity.Goods"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
if(session.getAttribute("username")==null)
	response.sendRedirect("login.jsp");
request.setCharacterEncoding("UTF-8");
String snack_number=request.getParameter("snack_number");
Goodsdaoimpl gdimpl=new Goodsdaoimpl();
Goods goods=null;
goods=gdimpl.find(snack_number);
String name1=request.getParameter("name");
String price=request.getParameter("price");
String class1=request.getParameter("class");
float price1=Float.parseFloat(price);

goods.setSnack_name(name1);
goods.setSnack_price(price1);
goods.setSnack_class(class1);
gdimpl.update(goods);
response.sendRedirect("goodctrl.jsp");
%>
</body>
</html>